
<template>
  <div>
    <h1 @click="say">{{myName}}</h1>
    <h2>{{sex}}</h2>
  </div>
</template>
<script lang="ts">
import { Component, Vue, Prop } from "vue-property-decorator";
@Component
export default class My extends Vue {
  public myName: any = "小李";
  // @Prop(String) readonly name!: string | undefined;
  // @Prop({ default: 30, type: Number }) private age!: number;
  @Prop([String, Boolean]) public sex!: string | boolean;
  public say(): void {
    alert(1);
  }
  // mounted() {
  //   alert(2);
  // }
}
</script>
<style lang="less">
</style>